package com.crazy.bookstore.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.crazy.bookstore.entity.Book;
import com.crazy.bookstore.exception.MyException;
import com.crazy.bookstore.vo.BookForAdminVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface BookService {
    /**
     * 分页查询图书
     * @param categoryId 分类编号
     * @param order 排序方式
     * @param page 页号
     * @param rows 每页记录数
     * @return 分页对象
     */
     IPage<Book> selectPage(Long categoryId, String order, Integer page, Integer rows);

    Book selectById(Long bookId);

    @Transactional(rollbackFor = Exception.class)
    void updateScore();

    IPage<BookForAdminVO> selectBookList(Integer page, Integer row);

    void createBook(Book book);

    void updateBook(Book book);

    void deleteBook(Integer bookId);
}
